package org.db2.project.airline.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.io.Serializable;
import java.util.Date;

/**
 * The persistent class for the FLIGHTPLAN database table.
 */
@Entity
public class FlightPlan implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @SequenceGenerator(name = "FLIGHTPLAN_ID_GENERATOR", sequenceName = "FLIGHTPLAN_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "FLIGHTPLAN_ID_GENERATOR")
    private long id;

    @Temporal(TemporalType.TIMESTAMP)
    private Date arrivalTime;

    private String code;

    @Temporal(TemporalType.TIMESTAMP)
    private Date departureTime;

    private long standardLagguageWeight;

    //bi-directional many-to-one association to Flight
    @ManyToOne
    @JoinColumn(name = "FLIGHTID")
    private Flight flight;

    //bi-directional many-to-one association to FlightRoute
    @ManyToOne
    @JoinColumn(name = "FLIGHTROUTEID")
    private FlightRoute flightRoute;

    //bi-directional many-to-one association to FlightStatus
    @ManyToOne
    @JoinColumn(name = "FLIGHTSTATUSID")
    private FlightStatus flightStatus;

    //bi-directional many-to-one association to FlightType
    @ManyToOne
    @JoinColumn(name = "FLIGHTTYPEID")
    private FlightType flightType;

    public FlightPlan() {
    }

    public long getId() {
        return this.id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Date getArrivalTime() {
        return this.arrivalTime;
    }

    public void setArrivalTime(Date arrivalTime) {
        this.arrivalTime = arrivalTime;
    }

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Date getDepartureTime() {
        return this.departureTime;
    }

    public void setDepartureTime(Date departureTime) {
        this.departureTime = departureTime;
    }

    public long getStandardLagguageWeight() {
        return this.standardLagguageWeight;
    }

    public void setStandardLagguageWeight(long standardLagguageWeight) {
        this.standardLagguageWeight = standardLagguageWeight;
    }

    public Flight getFlight() {
        return this.flight;
    }

    public void setFlight(Flight flight) {
        this.flight = flight;
    }

    public FlightRoute getFlightRoute() {
        return this.flightRoute;
    }

    public void setFlightRoute(FlightRoute flightRoute) {
        this.flightRoute = flightRoute;
    }

    public FlightStatus getFlightStatus() {
        return this.flightStatus;
    }

    public void setFlightStatus(FlightStatus flightStatus) {
        this.flightStatus = flightStatus;
    }

    public FlightType getFlightType() {
        return this.flightType;
    }

    public void setFlightType(FlightType flightType) {
        this.flightType = flightType;
    }

}